#include"TcpServer.hpp"
#include<memory>
#include"Log.hpp"
#include"Socket.hpp"
#include"Http.hpp"
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cerr << "Usage: " << argv[0] << "serverport" << std::endl;
        exit(-1);
    }
    uint16_t port = std::stoi(argv[1]);
    http_service http;
    server_t http_print_func = std::bind(&http_service::HanderHttpService,&http,std::placeholders::_1);
    std::unique_ptr<TcpServer> service = std::make_unique<TcpServer>(http_print_func,port);

    service->Start();
    return 0;
}